Skip to content

fix 4.7 return type error in _get_rid()#171

Open
thebuddyadrian wants to merge 1 commit into
rsubtil:masterfrom
thebuddyadrian:4.7-get_rid-fix
Open

fix 4.7 return type error in _get_rid()#171
thebuddyadrian wants to merge 1 commit into
rsubtil:masterfrom
thebuddyadrian:4.7-get_rid-fix

Conversation

@thebuddyadrian

Copy link
Copy Markdown

After upgrading a project using the Controller Icons addon to 4.7, the get_rid() method of ControllerIconTexture gives the following error: Cannot return value of type "int" because the function return type is "RID". This has been fixed by returning RID() instead of 0.

@Rouli-M

Rouli-M commented Jun 20, 2026

Copy link
Copy Markdown

Upgrading my project from Godot 4.6 to Godot 4.7, this fixed the issue for me.

@rsubtil rsubtil left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change! Just one extra change that's needed 😉

else:
return 0
return RID()
return _texture_3d.get_rid() if not _textures.is_empty() else 0

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing this spot:

Suggested change
return _texture_3d.get_rid() if not _textures.is_empty() else 0
return _texture_3d.get_rid() if not _textures.is_empty() else RID()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants